package org.gitman.agentplatform.ui.actions;

import java.awt.event.ActionEvent;

import org.gitman.agentplatform.core.MultiRunParameters;
import org.gitman.agentplatform.ui.api.View;
import org.gitman.agentplatform.ui.api.View.MessageType;
import org.gitman.agentplatform.ui.utils.ResourcesLoader;

public class MultiRunAction extends UIAction {

	public MultiRunAction() {
		super(null, ResourcesLoader.getInstance().getIcon("multirun.png"));
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		MultiRunParameters params = null;
		try{
			params = mainFrame.getSimulationPanel().getMultiRunParams();
			platformManager.getSimulation().verifyMultiRunParams(params);
			platformManager.getSimulation().multirun(params);
		}catch (Exception ex) {
			ex.printStackTrace();
			View.showMessage(ex.getMessage(), MessageType.ERROR);			
		}		
	}

}
